package com.jayson.myssm.controller;

import com.alibaba.druid.support.json.JSONUtils;
import com.jayson.myssm.pojo.Account;
import com.jayson.myssm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/demo")
public class DemoController {

    @Autowired
    private AccountService accountService;

    @ResponseBody
    @RequestMapping("/index")
    public List<Account> index(){
        List<Account> accountList = accountService.findAll();
        return accountList;
    }
}
